package com.yunxi.service.localService.impl.vip;

import com.github.pagehelper.PageInfo;
import com.yunxi.core.page.PageHelperPlus;
import com.yunxi.core.service.ServiceImplPlus;
import com.yunxi.core.util.BeanTools;
import com.yunxi.core.web.LoginInfo;
import com.yunxi.dao.vip.VipApplyMapper;
import com.yunxi.model.vip.VipApply;
import com.yunxi.order.pojo.OrderCustomerExOrderOemSaveReqVO;
import com.yunxi.service.localService.vip.VipApplyDetailService;
import com.yunxi.service.localService.vip.VipApplyService;
import com.yunxi.vip.pojo.VipApplyVO;
import com.yunxi.vip.pojo.VipVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 
 * @since 2019-09-06
 */
@Service
public class VipApplyServiceImpl extends ServiceImplPlus<VipApplyMapper, VipApply> implements VipApplyService {

    @Override
    public PageInfo<VipApplyVO> pageWait(VipApplyVO vipApplyVO,Integer pageNum,Integer pageSize, LoginInfo loginInfo) {
        PageHelperPlus.startPage(pageNum, pageSize);
        List<VipApplyVO> list = baseMapper.pageWait(BeanTools.bean2map(vipApplyVO));
        PageInfo<VipApplyVO> pageInfo = new PageInfo<VipApplyVO>(list);
        return pageInfo;
    }

    @Override
    public VipApplyVO getByCas(String applyId) {
        return baseMapper.getByCas(applyId);
    }

    @Override
    public VipVO getVipByOrderCustomerNo(String orderCustomerNo) {
        return baseMapper.getVipByOrderCustomerNo(orderCustomerNo);
    }

    @Override
    public PageInfo<VipApplyVO> pageDone(VipApplyVO vipApplyVO, Integer pageNum, Integer pageSize, LoginInfo loginInfo) {
        PageHelperPlus.startPage(pageNum, pageSize);
        List<VipApplyVO> list = baseMapper.pageDone(BeanTools.bean2map(vipApplyVO));
        PageInfo<VipApplyVO> pageInfo = new PageInfo<VipApplyVO>(list);
        return pageInfo;
    }

    @Override
    public void updateDiscount(VipApplyVO vipApplyVO) {
        baseMapper.updateDiscount(vipApplyVO);
    }
}
